package fr.xgouchet.wedding.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.ui.RootPanel;

import fr.xgouchet.wedding.client.controller.FeedbackController;
import fr.xgouchet.wedding.client.controller.MainController;
import fr.xgouchet.wedding.client.presenter.NavigationPresenter;
import fr.xgouchet.wedding.client.view.NavigationView;

/**
 * Wedding app main module
 * 
 * @author x.gouchet
 * 
 */
public class Wedding implements EntryPoint {

	/**
	 * @see EntryPoint#onModuleLoad()
	 */
	public void onModuleLoad() {
		// create event bus
		HandlerManager eventBus = new HandlerManager(null);

		// create controllers
		FeedbackController feedback = new FeedbackController(eventBus);
		NavigationPresenter navbar = new NavigationPresenter(
				new NavigationView());
		MainController main = new MainController(eventBus);

		// start controllers
		feedback.go(RootPanel.get("feedback"));
		navbar.go(RootPanel.get("navbar"));
		main.go(RootPanel.get("content"));
	}

}
